package cn.tedu.io;

import java.io.File;
import java.util.Scanner;

//计算 用户输入的文件夹里 文件的总字节大小
public class T1_DiGui {
    public static void main(String[] args) {
        String str = new Scanner(System.in).nextLine();
        File file = new File(str);
//        File []f1 = file.listFiles();
         long count = totalsize(file);
        System.out.println(count);
    }
    public static long totalsize(File file){
        File []f1 = file.listFiles();
        long sum=0;
        for (int i = 0; i < f1.length ; i++) {
            if(f1[i].isFile()){
                sum = sum+f1[i].length();
            }else if(f1[i].isDirectory()){
                sum=sum+totalsize(f1[i]);
            }
        }
        return sum;
    }

}
